<% layout('layout') -%><!--加载全局布局文件-->
<!--NgC div start--->
<div ng-controller="JuicePackageCtrl" class="app-bg-gray" xmlns="http://www.w3.org/1999/html">
    <!-- 首页轮播图 -->
    <div class="am-list-news-hd am-cf am-padding-xs">
        <span class="am-center am-responsive-width am-badge am-badge-warning am-round am-padding-xs am-text-lg am-padding-left-sm am-padding-right-sm">甜蜜下午茶</span>
    </div>
    <div data-am-widget="slider" class="am-slider am-slider-a1" data-am-slider='{&quot;directionNav&quot;:false&quot;}' >
        <ul class="am-slides">
            <% lbt.forEach(function(item){ %>
            <li  ng-click="addToPackage(<%=item[0]%>)">
                <a class="am-block" href=""><img src="<%= item[1] %>"></a>
                <!--<div class="am-slider-desc"></div>-->
            </li>
            <% });%>
        </ul>
    </div>
    <% classify.forEach(function(item){ %>
    <div data-am-widget="list_news" class="am-list-news am-list-news-default app-bg-white am-margin-0 am-padding-xs" >
        <div class="am-list-news-hd am-cf am-padding-xs">
            <span class="am-fl am-badge am-badge-warning am-round am-padding-xs am-text-sm am-padding-left-sm am-padding-right-sm"><%= item.title %></span>
        </div>
        <div class="am-slider am-slider-default am-slider-carousel" data-am-flexslider="{itemWidth: 200, itemMargin: 5, slideshow: false,controlNav:false}">
            <ul class="am-slides">
                <% item.list.forEach(function(p){ %>

                <li ng-click="addToPackage(<%=p.id%>)">
                    <a class="am-block" href=""><img src="<%= JSON.parse(p.get('picurlarray'))[0] %>"></a>
                    <span class="scor-font-weight-700 scor-font-size-18 scor-color-gr-font"><%= p.get('name') %></span>
                    <div>
                        <span class="am-fl scor-font-size-15 scor-color-gr-font">原价:￥<%=p.get('spec')[p.get('minSpec')].grprice %></span>
                        <span class="am-fr scor-font-size-15 scor-font-weight-700 scor-color-gr-font">套餐价:￥<span class=" scor-font-size-20" ><%= p.get('spec')[p.get('minSpec')].price  %></span></span>
                    </div><!--<div class="am-slider-desc"></div>-->
                </li>
                <% });%>
            </ul>
        </div>
    </div>
    <% });%>
    <div class="am-list-news-hd am-cf am-padding-xs">
        <span class="am-center am-responsive-width am-badge am-badge-warning am-round am-padding-xs am-text-lg am-padding-left-sm am-padding-right-sm">我的套餐</span>
    </div>
    <div class="">
        <div class="am-list-news-bd" >
            <ul class="am-list" >
                <li ng-repeat="product in myPackageList" class="am-g am-list-item-desced am-list-item-thumbed am-list-item-thumb-left" ng-click="">
                    <div class="am-u-sm-1 am-list-thumb" ng-click="deletePro(product.pid,product.psid)">
                        <span class="am-text-warning am-icon-trash" ></span>
                    </div>
                    <div class=" am-u-sm-4 am-list-main">
                        <!--标题-->
                        <span class=""> {{product.name}}</span>
                    </div>
                    <div class=" am-u-sm-2 am-list-main">
                        <span class="am-text-danger"><b>{{product.psName}}</b></span>
                    </div>
                    <div class=" am-u-sm-2 am-list-main">
                        <span class="am-text-danger"><b>{{product.count}}</b></span>
                    </div>
                    <div class=" am-u-sm-3 am-list-main">
                        <!-- 套餐价-->
                        <span class="am-text-danger" ng-if="isPackage===1"><b>￥{{product.psPrice}}</b></span>
                        <!-- 非套餐价-->
                        <span class="am-text-danger" ng-if="isPackage===0"><b>￥{{product.psGrprice}}</b></span>
                    </div>

                </li>
            </ul>
        </div>
    </div>
    <div class="am-text-center ">
        <div class="am-g am-text-center">
            <div class="am-u-sm-6 am-padding-horizontal-sm am-text-center">
                <span class="am-padding-horizontal-xl am-btn scor-border-radius-5 am-btn-warning scor-font-weight-300">套餐价</span>
            </div>
            <div class="am-u-sm-6 am-padding-horizontal-sm am-text-center">
                <span class="am-padding-horizontal-lg am-btn scor-border-radius-5 am-btn-warning scor-font-weight-300">{{accountAll}}元</span>
            </div>
        </div>
        <div class="am-g am-text-center am-margin-top">
            <div class="am-u-sm-6 am-padding-horizontal-sm am-text-center">
                <span class="am-padding-horizontal am-btn scor-border-radius-5 am-btn-default scor-border-gr-blod scor-color-gr-font scor-font-weight-300" >优惠：{{account}}元</span>
            </div>
            <div class="am-u-sm-6 am-padding-horizontal-sm am-text-center">
                <span class="am-padding-horizontal-lg am-btn scor-border-radius-5 am-btn-danger scor-font-weight-300" ng-click="orderNow(accountAll,isPackage)" ng-disabled="accountNow===0">{{accountAll|filterAccount}}</span>

                <!--<a href="../order/confirmPackageOrder/0">-->
                    <!--<span class="am-padding-horizontal-lg am-btn am-btn-xl scor-border-radius-5 am-btn-danger scor-font-weight-700">立即结算</span>-->
                <!--</a>-->
            </div>
        </div>
    </div>

    <div class="am-modal-actions" id="addNewProToPackage">
        <div class="am-list am-margin-0" style="background-color: ivory">
            <div class=" am-margin-xs am-padding-top" style="height: 15px !important;">
                <span class="am-fl am-margin-xs">规格:</span>
                <div class="am-fl"  data-am-button1 style="top: -5px;position: relative;overflow: hidden" ng-repeat="spec in proSpec">
                    <label style="margin:5px" class="am-btn am-btn-primary-nico am-text-xs"  ng-class="{'am-active':radio.isChecked==spec.psid}" >
                        <input type="radio" ng-model="radio.isChecked" value="" name="specBtn" class="am-hide "
                               ng-click="select(spec.spec.price,spec.psid)"/>
                        <span class="am-navbar-label" >{{spec.spec.name}}</span>
                    </label>
                </div>
            </div>
            <br/>
            <!--<div class="am-block">&nbsp;</div>-->
            <div class=" am-margin-top am-text-left am-margin-left-sm " style="">
                <span >价格:</span><span class='am-text-xl am-text-warning' style="top: 4px;position: relative;">￥{{price}}</span>
            </div>
            <div class="am-margin-bottom-sm am-margin-sm am-text-left" style="padding-bottom: 20px;clear:both;">
                <span >购买数量：</span>
                <div class="display-inline-block float-right shop-cnt" style="top:-10px;position:relative;">
                <span class="minus text-center font-size-36p white detail-minus"
                      ng-click="minus()">-</span>
                <span class=" text-center  shop-num color-FF6F2E">
                    <span class="detail-datasize" ng-bind="data.size"></span>
                    </span>
                <span class="plus text-center font-size-36p white detail-plus"
                      ng-click="plus()">+</span>
                </div>
            </div>
        </div>
        <div class="am-modal-actions-group am-margin-0" style="background-color: ivory">
            <button class="am-btn am-btn-secondary am-btn-block"  ng-click="savePackage(data.size)" data-am-modal-close>加入套餐</button>
        </div>
    </div>
    <div class="am-modal-actions" id="updatePackage">
        <div class="am-modal-actions-group am-list">
            <div class="am-badge-primary" style="width: 100%;height:50%;">
                {{proName}}
                {{proSpec}}
                {{proId}}
            </div>
        </div>
        <div class="am-modal-actions-group">
            <!--data-am-modal-close-->
            <button class="am-btn am-btn-secondary am-btn-block" ng-click="savePackage()" >加入套餐</button>
        </div>
    </div>
</div>

<!---启用底部navbar-->
<% include ../navbar.ejs %>
<% block('footer').append('<script src="'+CDN+'script/juicePackage.js"></script>') %>